package com.supplychain.scm.core.common.filter;

import com.alibaba.fastjson.serializer.PropertyFilter;

/**
 * json过滤器，排除null/""
 * @author like
 * @date 2023-09-16
 */
public class JsonExcludeEmptyPropertyFilter implements PropertyFilter {

	@Override
	public boolean apply(Object object, String name, Object value) {
		if(value == null) {
			return false;
		}
		if(value instanceof String &&((String) value).isEmpty()) {
			return false;
		}
		return true;
	}
}
